


//
//  ZYNewsMessageCell.m
//  优学荟管理系统
//
//  Created by edz on 2017/11/3.
//  Copyright © 2017年 星道三好. All rights reserved.
//

#import "ZYNewsMessageCell.h"
#import "ZYNewsMessageModel.h"
@implementation ZYNewsMessageCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setUpSuperView];
    }
    
    
    
    return self;
    
    
    
}


- (void)assignByZYNewsMessageModel:(ZYNewsMessageModel *)model{
    
    self.nameLbel.text = [NSString stringWithFormat:@"%@",[model.user valueForKey:@"petName"]];
    self.timeLabel.text = [NSString stringWithFormat:@"%@",model.createTime];
    self.teacherLabel.text = [NSString stringWithFormat:@"%@",model.content];
    
    
    
    
    
}


-(void)setUpSuperView {
    
    self.nameLbel = [UILabel new];
    self.nameLbel.font = [UIFont systemFontOfSize:12];
    self.nameLbel.textColor = ColorRGB(51, 51, 51);
    [self.contentView addSubview:self.nameLbel];
    
    
    self.teacherLabel = [UILabel new];
    self.teacherLabel.font = [UIFont systemFontOfSize:14];
    self.teacherLabel.textColor = ColorRGB(51, 51, 51);
    [self.contentView addSubview:self.teacherLabel];
    
    self.timeLabel = [UILabel new];
    self.timeLabel.font = [UIFont systemFontOfSize:11];
    self.timeLabel.textColor = ColorRGB(102,102,102);
    [self.contentView addSubview:self.timeLabel];
    
    
   
    self.nameLbel.text = @"评价课程名称";
    [self.nameLbel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.offset(15);
        make.top.offset(15);
        
        
        
    }];
    
    
    self.timeLabel.text = @"2015.10.11";
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-8);
        make.top.centerY.equalTo(self.nameLbel);
        
        
    }];
    
    
    self.teacherLabel.text = @"张宇老师张宇老师张宇老师张宇老师张宇老师张宇老师张宇老师张宇老师张宇老师";
    self.teacherLabel.numberOfLines = 0;
    [self.teacherLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.nameLbel);
        make.top.equalTo(self.nameLbel.mas_bottom).offset(10);
        make.right.equalTo(self).offset(-100);
        
    }];
  
    
    
    
    
    
    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.offset(0);
        make.bottom.mas_equalTo(self.teacherLabel).offset(10);
    }];
}


@end
